package com.major.controller;

import com.major.bean.User;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UserController2 implements Controller {
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mv = new ModelAndView();
        User user = new User(1,"zhangsan张三");
        mv.addObject("user",user);
        mv.setViewName("hello");
        System.out.println(2);
        return mv;
    }
}
